[bash] files indexed by production date

Posted by caas on Stack Overflow See other posts from Stack Overflow or by caas
Published on 2010-05-12T21:35:41Z Indexed on 2010/05/13 3:04 UTC
Read the original article Hit count: 226

Filed under:
|
|
|

Each day an application creates a file called file_YYYYMMDD.csv where YYYYMMDD is the production date. But sometimes the generation fails and no files are generated for a couple of days.

I'd like an easy way in a bash or sh script to find the filename of the most recent file, which has been produced before a given reference date.

Typical usage: find the last generated file, disregarding those produced after the May 1st.

Thanks for your help

© Stack Overflow or respective owner

Related posts about bash

Related posts about shell